<?php
	require_once(dirname(__FILE__)."./include/modify_psd_data.php");
?>
<!DOCTYPE html>
<html>
<head>
<script language="javascript" type="text/javascript">
//<![CDATA[
function CheckValid()
{
	if ( document.getElementById("oldpassword").value == "" )
	{
		window.alert("旧密码不能为空");
		return false;
	}
	else if ( document.getElementById("password").value == "" )
	{
		window.alert("新密码不能为空");
		return false;
	}
	else if ( document.getElementById("password").value != document.getElementById("confirm").value )
	{
		window.alert("两次输入的密码不一致");
		return false;
	}
	else
		return true;
}
//]]>
</script>
</head>

<body>
<form action = "modify_psd.php" method="post" onsubmit="return CheckValid()">
<table boder = "0">
<tr>
	<td>账号:</td>
	<td><?php echo htmlspecialchars($_SESSION["user"]); ?></td>
</tr>
<tr>
	<td>旧密码:</td>
	<td>
		<input type="password" id="oldpassword" name="oldpassword" required="required" />
		<span style="color:red">*</span>
	</td>
</tr>
<tr>
	<td>新密码:</td>
	<td>
		<input type="password" id="password" name="password" required="required" />
		<span style="color:red">*</span>
	</td>
</tr>
<tr>
	<td>确认密码:</td>
	<td>
		<input type="password" id="confirm" name="confirm" required="required" />
		<span style="color:red">*</span>
	</td>
</tr>
<tr>
	<td></td>
	<td>
		<input type="submit" name="submit" value="提交" />
	</td>
</tr>
</table>
</form>
</body>
</html>